//
//  JWTCommons.h
//  JWT
//
//  Created by Apple on 2017/1/1.
//  Copyright © 2017年 com.jwtsoft. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface JWTCommons : NSObject
SHARED_INSTANCE_DEFINE(JWTCommons)

/**
 *下面为C全局函数 可以自己增加
 */

/*! get the fundation object from json string nsdata */
id NSJSONObjectWithData(NSData *nsdata);

/*! get the fundation object from json NSString */
id NSJSONObjectWithString(NSString *str);
/* get the json string data from the fundation object */
//#define NSJSONDataWithObject(dicObject)  [NSJSONSerialization dataWithJSONObject:dicObject options:NSJSONWritingPrettyPrinted error:nil]
id NSJSONDataWithObject(id dicObject);

/*! get the json string data from the fundation object */
NSString* NSJSONStringWithObject(NSDictionary* dicObject);

/**获取导航条的高度*/
float getNAVI_TOP_HEIGHT();

/**获取下面TabBar条的高度*/
float getTABBar_bottom_HEIGHT();

/**判断对象是否为空*/
BOOL isEmpty(id obj);

//将颜色转换成图片
+(UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size;

//校验手机号格式
-(NSInteger)validateMobile:(NSString *)mobile;

/**
 字典转json
 */
- (NSString*)dictionaryToJson:(NSDictionary *)dic;

/**
 保存图片
 */
+(NSString*)saveToDocument:(UIImage*)image;


@end
